home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / man / cat.1 / cproto.1 < prev    next >
Text File  |  1995-07-25  |  12KB  |  331 lines

  1.  
  2.  
  3.  
  4.      CCCCPPPPRRRROOOOTTTTOOOO((((1111))))         UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((MMMMaaaayyyy 22224444,,,, 1111999999993333))))          CCCCPPPPRRRROOOOTTTTOOOO((((1111))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           cproto - generate C function prototypes and convert function
  10.           definitions
  11.  
  12.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.           ccccpppprrrroooottttoooo [ _o_p_t_i_o_n ... ] [ _f_i_l_e ... ]
  14.  
  15.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  16.           CCCCpppprrrroooottttoooo generates function prototypes for functions defined
  17.           in the specified C source files to the standard output.  The
  18.           function definitions may be in the old style or ANSI C
  19.           style.  Optionally, ccccpppprrrroooottttoooo also outputs declarations for
  20.           variables defined in the files.  If no _f_i_l_e argument is
  21.           given, ccccpppprrrroooottttoooo reads its input from the standard input.
  22.  
  23.           By giving a command line option, ccccpppprrrroooottttoooo will also convert
  24.           function definitions in the specified files from the old
  25.           style to the ANSI C style.  The original source files along
  26.           with files specified by
  27.  
  28.                #include "file"
  29.  
  30.           directives appearing in the source code will be overwritten
  31.           with the converted code.  If no file names are given on the
  32.           command line, then the program reads the source code from
  33.           the standard input and outputs the converted source to the
  34.           standard output.
  35.  
  36.           If any comments appear in the parameter declarations for a
  37.           function definition, such as in the example,
  38.  
  39.                main (argc, argv)
  40.                int argc;       /* number of arguments */
  41.                char *argv[];   /* arguments */
  42.                {
  43.                }
  44.  
  45.           then the converted function definition will have the form
  46.  
  47.                int
  48.                main (
  49.                    int argc,       /* number of arguments */
  50.                    char *argv[]   /* arguments */
  51.                )
  52.                {
  53.                }
  54.  
  55.           Otherwise, the converted function definition will look like
  56.  
  57.                int
  58.                main (int argc, char *argv[])
  59.                {
  60.  
  61.  
  62.  
  63.      Page 1                                           (printed 3/9/94)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      CCCCPPPPRRRROOOOTTTTOOOO((((1111))))         UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((MMMMaaaayyyy 22224444,,,, 1111999999993333))))          CCCCPPPPRRRROOOOTTTTOOOO((((1111))))
  71.  
  72.  
  73.  
  74.                }
  75.  
  76.  
  77.           CCCCpppprrrroooottttoooo can optionally convert function definitions from the
  78.           ANSI style to the old style.  In this mode, the program also
  79.           converts function declarators and prototypes that appear
  80.           outside function bodies.  This is not a complete ANSI C to
  81.           old C conversion.  The program does not change anything
  82.           within function bodies.
  83.  
  84.      OOOOPPPPTTTTIIIIOOOONNNNSSSS
  85.           ----eeee   Output the keyword eeeexxxxtttteeeerrrrnnnn in front of every generated
  86.                prototype or declaration that has global scope.
  87.  
  88.           ----ffff_n  Set the style of generated function prototypes where _n
  89.                is a number from 0 to 3.  For example, consider the
  90.                function definition
  91.  
  92.                     main (argc, argv)
  93.                     int argc;
  94.                     char *argv[];
  95.                     {
  96.                     }
  97.  
  98.                If the value is 0, then no prototypes are generated.
  99.                When set to 1, the output is:
  100.  
  101.                     int main(/*int argc, char *argv[]*/);
  102.  
  103.                For a value of 2, the output has the form:
  104.  
  105.                     int main(int /*argc*/, char */*argv*/[]);
  106.  
  107.                The default value is 3.  It produces the full function
  108.                prototype:
  109.  
  110.                     int main(int argc, char *argv[]);
  111.  
  112.  
  113.           ----cccc   The parameter comments in the prototypes generated by
  114.                the -f1 and -f2 options are omitted by default.  Use
  115.                this option to enable the output of these comments.
  116.  
  117.           ----mmmm   Put a macro around the parameter list of every
  118.                generated prototype.  For example:
  119.  
  120.                     int main P_((int argc, char *argv[]));
  121.  
  122.  
  123.           ----MMMM_n_a_m_e
  124.                Set the name of the macro used to surround prototype
  125.                parameter lists when option -m is selected.  The
  126.  
  127.  
  128.  
  129.      Page 2                                           (printed 3/9/94)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      CCCCPPPPRRRROOOOTTTTOOOO((((1111))))         UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((MMMMaaaayyyy 22224444,,,, 1111999999993333))))          CCCCPPPPRRRROOOOTTTTOOOO((((1111))))
  137.  
  138.  
  139.  
  140.                default is "P_".
  141.  
  142.           ----dddd   Omit the definition of the prototype macro used by the
  143.                -m option.
  144.  
  145.           ----pppp   Disable promotion of formal parameters in old style
  146.                function definitions.  By default, parameters of type
  147.                cccchhhhaaaarrrr or sssshhhhoooorrrrtttt in old style function definitions are
  148.                promoted to type iiiinnnntttt in the function prototype or
  149.                converted ANSI C function definition.  Parameters of
  150.                type ffffllllooooaaaatttt get promoted to ddddoooouuuubbbblllleeee as well.
  151.  
  152.           ----qqqq   Do not output any error messages when the program
  153.                cannot read the file specified in an #_i_n_c_l_u_d_e
  154.                directive.
  155.  
  156.           ----ssss   By default, ccccpppprrrroooottttoooo only generates declarations for
  157.                functions and variables having global scope.  This
  158.                option will output ssssttttaaaattttiiiicccc declarations as well.
  159.  
  160.           ----vvvv   Also output declarations for variables defined in the
  161.                source.
  162.  
  163.           ----aaaa   Convert function definitions from the old style to the
  164.                ANSI C style.
  165.  
  166.           ----tttt   Convert function definitions from the ANSI C style to
  167.                the traditional style.
  168.  
  169.           ----bbbb   Rewrite function definition heads to include both old
  170.                style and new style declarations separated by a
  171.                conditional compilation directive.  For example, the
  172.                program can generate this function definition:
  173.  
  174.                     #ifdef ANSI_FUNC
  175.  
  176.                     int
  177.                     main (int argc, char *argv[])
  178.                     #else
  179.  
  180.                     int
  181.                     main (argc, argv)
  182.                     int argc;
  183.                     char *argv[]
  184.                     #endif
  185.                     {
  186.                     }
  187.  
  188.  
  189.           ----BBBB_d_i_r_e_c_t_i_v_e
  190.                Set the conditional compilation directive to output at
  191.                the beginning of function definitions generated by the
  192.  
  193.  
  194.  
  195.      Page 3                                           (printed 3/9/94)
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.      CCCCPPPPRRRROOOOTTTTOOOO((((1111))))         UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((MMMMaaaayyyy 22224444,,,, 1111999999993333))))          CCCCPPPPRRRROOOOTTTTOOOO((((1111))))
  203.  
  204.  
  205.  
  206.                -b option.  The default is
  207.  
  208.                     #ifdef ANSI_FUNC
  209.  
  210.  
  211.           ----PPPP_t_e_m_p_l_a_t_e
  212.           ----FFFF_t_e_m_p_l_a_t_e
  213.           ----CCCC_t_e_m_p_l_a_t_e
  214.                Set the output format for generated prototypes,
  215.                function definitions, and function definitions with
  216.                parameter comments respectively.  The format is
  217.                specified by a template in the form
  218.  
  219.                     " int f ( a, b )"
  220.  
  221.                but you may replace each space in this string with any
  222.                number of whitespace characters.  For example, the
  223.                option
  224.  
  225.                     -F"int f(\n\ta,\n\tb\n\t)"
  226.  
  227.                will produce
  228.  
  229.                     int main(
  230.                             int argc,
  231.                             char *argv[]
  232.                             )
  233.  
  234.  
  235.           ----DDDD_n_a_m_e[=_v_a_l_u_e]
  236.                This option is passed through to the preprocessor and
  237.                is used to define symbols for use with conditionals
  238.                such as #_i_f_d_e_f.
  239.  
  240.           ----UUUU_n_a_m_e
  241.                This option is passed through to the preprocessor and
  242.                is used to remove any definitions of this symbol.
  243.  
  244.           ----IIII_d_i_r_e_c_t_o_r_y
  245.                This option is passed through to the preprocessor and
  246.                is used to specify a directory to search for files that
  247.                are referenced with #_i_n_c_l_u_d_e.
  248.  
  249.           ----EEEE_c_p_p
  250.                Pipe the input files through the specified C
  251.                preprocessor command when generating prototypes.  By
  252.                default, the program uses /lib/cpp.
  253.  
  254.           ----EEEE_0  Do not run the C preprocessor.
  255.  
  256.           ----VVVV   Print version information.
  257.  
  258.  
  259.  
  260.  
  261.      Page 4                                           (printed 3/9/94)
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.      CCCCPPPPRRRROOOOTTTTOOOO((((1111))))         UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((MMMMaaaayyyy 22224444,,,, 1111999999993333))))          CCCCPPPPRRRROOOOTTTTOOOO((((1111))))
  269.  
  270.  
  271.  
  272.      EEEENNNNVVVVIIIIRRRROOOONNNNMMMMEEEENNNNTTTT
  273.           The environment variable CPROTO is scanned for a list of
  274.           options in the same format as the command line options.
  275.           Options given on the command line override any corresponding
  276.           environment option.
  277.  
  278.      BBBBUUUUGGGGSSSS
  279.           If an untagged struct, union or enum declaration appears in
  280.           a generated function prototype or converted function
  281.           definition, the content of the declaration between the
  282.           braces is empty.
  283.  
  284.           The program does not pipe the source files through the C
  285.           preprocessor when it is converting function definitions.
  286.           Instead, it tries to handle preprocessor directives and
  287.           macros itself and can be confused by tricky macro
  288.           expansions.  The conversion also discards some comments in
  289.           the function definition head.
  290.  
  291.           The -v option does not generate declarations for variables
  292.           defined with the eeeexxxxtttteeeerrrrnnnn specifier.  This doesn't strictly
  293.           conform to the C language standard but this rule was
  294.           implemented because include files commonly declare variables
  295.           this way.
  296.  
  297.           When the program encounters an error, it usually outputs the
  298.           not very descriptive message "syntax error".
  299.  
  300.           Options that take string arguments only interpret the
  301.           following character escape sequences:
  302.  
  303.                \n   newline
  304.                \t   tab
  305.  
  306.  
  307.      AAAAUUUUTTTTHHHHOOOORRRR
  308.           Chin Huang
  309.           cthuang@zerosan.UUCP
  310.           chin.huang@canrem.com
  311.  
  312.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  313.           cc(1), cpp(1)
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.      Page 5                                           (printed 3/9/94)
  328.  
  329.  
  330.  
  331.